@(active: String,
  newButton: Boolean,
  repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
  condition: Option[gitbucket.core.service.IssuesService.IssueSearchCondition] = None)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
<ul class="nav nav-pills-group  pull-left fill-width">
  <li class="@if(active == "issues"    ){active} first"><a href="@url(repository)/issues">Issues</a></li>
  <li class="@if(active == "pulls"     ){active}"><a href="@url(repository)/pulls">Pull requests</a></li>
  <li class="@if(active == "labels"    ){active}"><a href="@url(repository)/issues/labels">Labels</a></li>
  <li class="@if(active == "milestones"){active} last"><a href="@url(repository)/issues/milestones">Milestones</a></li>
  <li class="pull-right">
    <form method="GET" id="search-filter-form" style="margin-bottom: 0px;">
      @condition.map { condition =>
        @if(loginAccount.isDefined){
          <div class="input-prepend" style="margin-bottom: 0px;">
            <div class="btn-group">
              <button type="button" class="btn dropdown-toggle" data-toggle="dropdown" style="height: 34px;">
                Filter
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu">
                <li><a href="?q=is:open">Open issues and pull requests</a></li>
                <li><a href="?q=is:open+is:issue+author:@urlEncode(loginAccount.get.userName)">Your issues</a></li>
                <li><a href="?q=is:open+is:pr+author:@urlEncode(loginAccount.get.userName)">Your pull requests</a></li>
                <li><a href="?q=is:open+assignee:@urlEncode(loginAccount.get.userName)">Everything assigned to you</a></li>
                @*
                <li><a href="?q=is:open+mentions:@urlEncode(loginAccount.get.userName)">Everything mentioning you</a></li>
                *@
              </ul>
            </div>
            <input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
          </div>
        } else {
          <input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
        }
      }
      @if(loginAccount.isDefined){
        <div class="btn-group">
          @if(newButton){
            @if(active == "issues"){
              <a class="btn btn-success" href="@url(repository)/issues/new" style="height: 24px;">New issue</a>
            }
            @if(active == "pulls"){
              <a class="btn btn-success" href="@url(repository)/compare" style="height: 24px;">New pull request</a>
            }
            @if(active == "labels"){
              <a class="btn btn-success" href="javascript:void(0);" id="new-label-button" style="height: 24px;">New label</a>
            }
            @if(active == "milestones"){
              <a class="btn btn-success" href="@url(repository)/issues/milestones/new" style="height: 24px;">New milestone</a>
            }
          }
        </div>
      }
    </form>
  </li>
</ul>
